#include<bits/stdc++.h>
using namespace std;

int main()
{
    int t,n;
    string s;
    for(cin>>t;t>0;t--)
    {
        cin>>n>>s;int cnt=0;
        for(int i=0;i<n;i++)
            if(s[i]=='U') cnt++;
        cout<<cnt<<endl;
        if(cnt%2==1)
            cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
    return 0;
}
